#include "selectServer.hpp"
#include <iostream>
#include <memory>
#include "err.hpp"

using namespace std;
using namespace YZC;

static void Usage(const string &proc)
{
    std::cerr << "Usage:\n\t" << proc << " port" << endl;
}

std::string transation(const std::string &request)
{
    return request;
}

//./server + 端口
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }

    unique_ptr<selectServer> svr(new selectServer(transation, atoi(argv[1])));

    svr->init();

    svr->run();
}